package com.hy.controller;



import com.hy.pojo.Address;
import com.hy.pojo.Hospital;
import com.hy.service.IAddressService;
import com.hy.service.IHospitalService;
import com.hy.util.Result;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2025-03-06
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private IAddressService addressService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public Result list(Address address) {
        List<Address> list = addressService.selectAddressList(address);
        return Result.success(list);
    }

    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/{id}")
    public Result getInfo(@PathVariable("id") Long id) {
        return Result.success(addressService.selectAddressById(id));
    }

    /**
     * 新增【请填写功能名称】
     */
    @PostMapping
    public Result add(@RequestBody Address address) {
        return Result.success(addressService.insertAddress(address));
    }

    /**
     * 修改【请填写功能名称】
     */
    @PutMapping
    public Result edit(@RequestBody Address address) {
        return Result.success(addressService.updateAddress(address));
    }

    /**
     * 删除【请填写功能名称】
     */
	@DeleteMapping("/{ids}")
    public Result remove(@PathVariable Long[] ids) {
        return Result.success(addressService.deleteAddressByIds(ids));
    }
}
